package com.igeek.javase.relation.game;

/**
 * @author chenmin
 * 2023/7/13 17:35
 * @description TODO
 */
public abstract class Role {

    private String name;
    private int level;
    private int blood;
    public int power;
    public int defence;
    private String kind;

    public Role() {
    }

    public Role(String name, int level, int blood, int power, int defence, String kind) {
        this.name = name;
        this.level = level;
        this.blood = blood;
        this.power = power;
        this.defence = defence;
        this.kind = kind;
    }



    //死亡判定方法
    public boolean isDead(){
        if(this.blood<=0){
            System.out.println("当前"+"已死亡");
            return true;
        }
        return false;
    }

    //基本攻击方法  多态参数Role
    public abstract void attack(Role role);

    //获取怪兽信息的方法
    public void show(){
        System.out.println(name+"的昵称："+name);
        System.out.println(name+"的等级："+level);
        System.out.println(name+"的血量："+blood);
        System.out.println(name+"的攻击力："+power);
        System.out.println(name+"的防御力："+defence);
        System.out.println(name+"的类别："+kind);
    }

    /**
     * 获取
     * @return name
     */
    public String getName() {
        return name;
    }

    /**
     * 设置
     * @param name
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * 获取
     * @return level
     */
    public int getLevel() {
        return level;
    }

    /**
     * 设置
     * @param level
     */
    public void setLevel(int level) {
        this.level = level;
    }

    /**
     * 获取
     * @return blood
     */
    public int getBlood() {
        return blood;
    }

    /**
     * 设置
     * @param blood
     */
    public void setBlood(int blood) {
        this.blood = blood;
    }

    /**
     * 获取
     * @return power
     */
    public int getPower() {
        return power;
    }

    /**
     * 设置
     * @param power
     */
    public void setPower(int power) {
        this.power = power;
    }

    /**
     * 获取
     * @return defence
     */
    public int getDefence() {
        return defence;
    }

    /**
     * 设置
     * @param defence
     */
    public void setDefence(int defence) {
        this.defence = defence;
    }

    /**
     * 获取
     * @return kind
     */
    public String getKind() {
        return kind;
    }

    /**
     * 设置
     * @param kind
     */
    public void setKind(String kind) {
        this.kind = kind;
    }

    public String toString() {
        return "Role{name = " + name + ", level = " + level + ", blood = " + blood + ", power = " + power + ", defence = " + defence + ", kind = " + kind + "}";
    }


}
